var ProjectRegisterSelector = {
	getView : function(h, f) {
		var g = null;
		if (f) {
			var g = new Ext.grid.CheckboxSelectionModel({
				singleSelect : true
			});
		} else {
			g = new Ext.grid.CheckboxSelectionModel();
		}
		var b = new Ext.grid.ColumnModel({
			columns : [g, new Ext.grid.RowNumberer(), {
						header : 'id',
						dataIndex : 'id',
						hidden : true
					}, {
						header : '申请号',
						dataIndex : 'proRegisterTitle'
					}, {
						header : '工程名称',
						dataIndex : 'proName'
					}],
			defaults : {
				sortable : true,
				menuDisabled : false,
				width : 100
			}
		});
		var c = new Ext.data.Store({
			proxy : new Ext.data.HttpProxy({
				url : __ctxPath + "/project/listProjectRegister.do"
			}),
			reader : new Ext.data.JsonReader({
				root : "result",
				totalProperty : "totalCounts",
				fields : [{
								name : 'id',
								type : 'int'
							}, 'proRegisterTitle','proName', 'businesser', 'businessSource',
							'bidUnit', 'props', 'moneyProps', 'proArea',
							'preAmount', 'preDuration','preDurationEnd', 'quality', 'useArea',
							'bidType', 'humanRelations', 'winBidProbability',
							'techBidMaker', 'economicBidMaker',
							'endBidDate', 'bidDeposit', 'registDate', 'remark',
							'status','processRunId']
			}),
			remoteSort : true
		});
		var d = new Ext.grid.GridPanel({
			id : "ProjectRegisterSelectorGrid",
			width : 600,
			height : 300,
			region : "center",
			title : "项目立项登记列表",
			store : c,
			shim : true,
			trackMouseOver : true,
			disableSelection : false,
			loadMask : true,
			cm : b,
			sm : g,
			viewConfig : {
				forceFit : true,
				enableRowBody : false,
				showPreview : false
			},
			bbar : new Ext.PagingToolbar({
				pageSize : 25,
				store : c,
				displayInfo : true,
				displayMsg : "当前显示从{0}至{1}， 共{2}条记录",
				emptyMsg : "当前没有记录"
			})
		});
		c.load({
			params : {
				start : 0,
				limit : 25
			}
		});
		var a = new Ext.FormPanel({
			width : 500,
			region : "north",
			id : "ProjectRegisterSelectorForm",
			height : 40,
			frame : false,
			border : false,
			layout : "hbox",
			layoutConfig : {
				padding : "5",
				align : "middle"
			},
			defaults : {
				xtype : "label",
				margins : {
					top : 0,
					right : 4,
					bottom : 4,
					left : 4
				}
			},
			items : [{
						text : "查询条件:"
					}, {
						style : 'margin-top:5px;',
						xtype : 'label',
						text : '申请号:'
					}, {
						name : 'Q_proRegisterTitle_S_LK',
						xtype : 'textfield'
					}, {
						style : 'margin-top:5px;',
						xtype : 'label',
						text : '工程名称:'
					}, {
						name : 'Q_proName_S_LK',
						xtype : 'textfield'
					}, {
						xtype : "button",
						text : "查询",
						iconCls : "search",
						handler : function() {
							var i = Ext.getCmp("ProjectRegisterSelectorForm");
							var j = Ext.getCmp("ProjectRegisterSelectorGrid");
							if (i.getForm().isValid()) {
								var params = c.baseParams;
								Ext.apply(params, i.getForm().getValues());
								c.load(params);
							}
						}
					}]
		});
		var e = new Ext.Window({
			title : "项目立项登记选择器",
			iconCls : "menu-project",
			width : 600,
			height : 380,
			layout : "border",
			border : false,
			items : [a, d],
			modal : true,
			buttonAlign : "center",
			buttons : [{
						iconCls : "btn-ok",
						text : "确定",
						handler : function() {
							var n = Ext.getCmp("ProjectRegisterSelectorGrid");
							var o = n.getSelectionModel().getSelections();
							var id = "";
							var proName = "";
							var proRegisterTitle = "";
							for (var m = 0; m < o.length; m++) {
								if (m > 0) {
									id += ",";
									proName += ",";
									proRegisterTitle += ",";
								}
								id += o[m].data.id;
								proName += o[m].data.proName;
								proRegisterTitle += o[m].data.proRegisterTitle;
							}
							if (h != null) {
								h.call(this, id, proName, proRegisterTitle);
							}
							e.close();
						}
					}, {
						text : "取消",
						iconCls : "btn-cancel",
						handler : function() {
							e.close();
						}
					}]
		});
		return e;
	}
};